package com.ruoyi.sales.service;

import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.ZcStock;

import java.util.List;

public interface IZcStockService {
    //查询管理数据
    List<ZcStock> selectStockList(ZcStock stock);

    //根据ID查询信息
    ZcStock selectStockById(Long stockId);

    //校验名称是否唯一
    boolean checkStockNameUnique(ZcStock stock);

    //新增
    int insertStock(ZcStock stock);

    //根据ID查询所有子部门（正常状态）
    int selectNormalChildrenStockById(Long stockId);

    //修改并保存
    int updateStock(ZcStock stock);

    //是否存在子节点
    boolean hasChildByStockId(Long stockId);

    //删除信息
    int deleteStockById(Long stockId);

    //查询树结构信息
    List<TreeSelect> selectStockTreeList(ZcStock stock);

    //构建前端所需要树结构
    List<ZcStock> buildStockTree(List<ZcStock> stocks);

    //构建前端所需要下拉树结构
    List<TreeSelect> buildStockTreeSelect(List<ZcStock> stocks);

    int updateStockStatus(ZcStock stock);
}
